package com.kede.ienum;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/***
 ** @Author:Pr.li
 ** @Description:来源渠道/领取方式 1线上  2线下
 ** @Date: create in 2023/5/15 22:53
 ***/
@Getter
@AllArgsConstructor
public enum SourceChannelEnum {
    ONLINE(1,"线上",1),
    OFFLINE(2,"线下",2);

    @EnumValue
    private Integer code;
    private String value;
    private Integer enumIndex;



    public static SourceChannelEnum parse(Integer code) {
        for (SourceChannelEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
